<?php
/**
 * Created by PhpStorm.
 * User: 技术员专用
 * Date: 2019/3/11
 * Time: 15:46
 */
$client=new swoole_client(SWOOLE_SOCK_UDP);
if (!$client->connect('127.0.0.1','9502')){
    echo '连接失败';
    exit();
}
fwrite(STDOUT,'请输入信息');
$msg=trim(fgets(STDIN));
$client->sendto('127.0.0.1','9502',$msg);
$result=$client->recv();
var_dump($result);